﻿<UserControl x:Class="Albatross.SharePoint.Explorer.Views.SiteObjectCollectionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:wpfViews="clr-namespace:Albatross.WPF.Common.Views;assembly=Albatross.WPF.Common"
			 xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
			 xmlns:system="clr-namespace:System;assembly=mscorlib"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/Albatross.SharePoint.Explorer;component/Resources/common.xaml"/>
			</ResourceDictionary.MergedDictionaries>
			<wpfViews:BooleanVisibilityConverter x:Key="bool2visibility"/>
			<wpfViews:NotConverter x:Key="notCvt"/>
		</ResourceDictionary>
	</UserControl.Resources>

	<Grid IsEnabled="{Binding IsLoading, Converter={StaticResource notCvt}}">
		<Border Background="Lavender">
			<DockPanel>
				<TextBlock DockPanel.Dock="Top" Text="{Binding Title, FallbackValue=ObjectName}" Background="Lavender" FontSize="14" Margin="5"/>
				<TabControl Background="Transparent">
					<TabItem Header="Properties" Background="Transparent">
						<DataGrid Style="{StaticResource DataGridStyle}" DockPanel.Dock="Bottom" Margin="5"
						  ItemsSource="{Binding Properties}" AutoGenerateColumns="False" SelectionMode="Extended" 
						  SelectionUnit="CellOrRowHeader" CanUserResizeColumns="True" CanUserResizeRows="True" BorderBrush="Silver">
							<DataGrid.Columns>
								<DataGridTextColumn Binding="{Binding Key, Mode=OneWay}" Header="Property Name" Width="1*"/>
								<DataGridTextColumn Binding="{Binding Value, Mode=OneWay}" Header="Value" Width="1*"/>
							</DataGrid.Columns>
						</DataGrid>
					</TabItem>
				</TabControl>
			</DockPanel>
		</Border>
		<wpfViews:LoadingView Visibility="{Binding IsLoading, Converter={StaticResource bool2visibility}}" />
	</Grid>
</UserControl>
